<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>Document Title</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<script type="text/javascript" src="prototype.js"></script>
	<script type="text/javascript" src="g2remote.js"></script>
	<style type="text/css">

	</style>
	<script type="text/javascript">
		window.onload = function() {
			var g = new G2Remote({
				gallery_url: "http://domain.com/path/to/gallery2/main.php"
			});

			g.fetchAlbumImages({
				albumName: "7",
				random: true,
				limit:10,
				extrafields:true
			}, function(r) {
				console.log(r);
				var div = $("test");

				r.image.each(function(img){
					if (!img) return;
					var url = r.baseurl.replace(/\\/g,"") + img.thumbName;
					var el = document.createElement("img");
					el.src = url;
					div.appendChild(el);
					console.log(url);
				});
			})
		};
	</script>
</head>
<body>
	<div id="test"></div>
</body>
</html>

